/**
 * 2018年5月11日下午8:42:24
 */
package com.an.nopro.app.framework.controller;

import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.an.nopro.app.framework.entity.Person;
import com.an.nopro.app.framework.service.PersonService;

/**

 * @目的：.<br>
 * 
 * @author 86171
 * @date 2018年5月11日下午8:42:24
 * 
 */
@RestController
@RequestMapping("/person")
public class PersonController {

	@Autowired
	private PersonService personService;
	
	@GetMapping(value= {"/getperson/{id}"})
	public Optional<Person> getPerson(@PathVariable String id,@ModelAttribute(name="person") Person p) {
		System.out.println("@ModelAttribute(name=\"person\")：" + p);
		return personService.getPersonById(id);
	}
}
